package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.RightBean;
import com.lwj.liwanjia.impl.JuliView;
import com.lwj.liwanjia.model.RightJlModel;

import java.util.Map;

import rx.Subscriber;

/**
 * Created by Administrator on 2017/11/8.
 */

public class RightJlPResenter {
    private JuliView juliView;
    private RightJlModel rightJlModel;

    public RightJlPResenter(JuliView juliView) {
        this.juliView = juliView;
        rightJlModel = new RightJlModel();
    }

    public void getRightJl(Map<String, Object> map) {
        if (juliView != null) {
            rightJlModel.getRightJuli(map, new Subscriber<RightBean>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                    juliView.showError((Exception) e);
                }

                @Override
                public void onNext(RightBean rightBean) {
                    juliView.getJuliData(rightBean);
                }
            });
        }
    }
}
